<template>
  <page-form :x-uri="uri" :x-tabs="tabs" :bind-data="datas" :bind-rules="rules" />
</template>

<script>
import PageForm from '@public/template/page_form.vue';

export default {
  components: {
    PageForm
  },
  data() {
    return {
      uri: 'admin/user/permission/create',
      tabs: [
        {
          title: '节点管理',
          uri: '/user/permission',
          meta: {
            permission: 'user.admin.permission.list'
          }
        },
        {
          title: '新建节点',
          uri: '/user/permission/create',
          meta: {
            permission: 'user.admin.permission.create'
          }
        }
      ],
      datas: {
        pid: this.$route.query.pid
      },
      rules: {
        permission: [
          { required: true, message: '节点标识必须填写', trigger: ['blur', 'change'] },
          {
            pattern: /^[\d\.\w]+$/,
            message: '节点标识由字母和英文点(`.`)组成',
            trigger: ['blur', 'change']
          }
        ]
      }
    };
  }
};
</script>
